//
//  Comment.m
//  auditorias
//
//  Created by Mauro on 7/21/13.
//  Copyright (c) 2013 Antilope. All rights reserved.
//

#import "Comment.h"
#import "DataLoader.h"

@implementation Comment

@synthesize externalId;
@synthesize message;
@synthesize date;
@synthesize userName;
@synthesize evaluatorMessage;
@synthesize evaluatorName;
@synthesize auditTypeId;

- (void) dealloc
{
    [externalId release], externalId = nil;
    [message release], message = nil;
    [date release], date = nil;
    [userName release], userName = nil;
    [evaluatorMessage release], evaluatorMessage = nil;
    [evaluatorName release], evaluatorName = nil;
    [auditTypeId release], auditTypeId = nil;
    [super dealloc];
}


- (id) initWithDictionary:(NSDictionary*)dictionary
{
    self = [super init];
    self.externalId = (![DataLoader isNull:[dictionary objectForKey:@"commentId"]]) ? [dictionary objectForKey:@"commentId"] : @"";
    self.message = (![DataLoader isNull:[dictionary objectForKey:@"comment"]]) ? [dictionary objectForKey:@"comment"] : @"";
    self.userName = (![DataLoader isNull:[dictionary objectForKey:@"userName"]]) ? [dictionary objectForKey:@"userName"] : @"";
    self.date = (![DataLoader isNull:[dictionary objectForKey:@"date"]]) ? [dictionary objectForKey:@"date"] : @"";
    self.evaluatorMessage = (![DataLoader isNull:[dictionary objectForKey:@"reviewComment"]]) ? [dictionary objectForKey:@"reviewComment"] : @"";
    self.evaluatorName = (![DataLoader isNull:[dictionary objectForKey:@"evaluatorName"]]) ? [dictionary objectForKey:@"evaluatorName"] : @"";
    self.auditTypeId = (![DataLoader isNull:[dictionary objectForKey:@"auditTypeId"]]) ? [dictionary objectForKey:@"auditTypeId"] : @"";
    return self;
}

@end
